package christ.mmd.bl;

import java.util.Date;

import android.os.Parcel;
import android.os.Parcelable;

public class FileUpdateInfo implements Parcelable {

	public static enum Type {
		days, events, communities, fasts, holidays, readings, images
	};

	Type mType;
	Date mDate;
	String mLink;

	public FileUpdateInfo(String relType, Date date, String link) {

		mType = Type.valueOf(relType);
		mDate = date;
		mLink = link;
	}

	public FileUpdateInfo(Parcel in) {
		this(in.readString(), new Date(in.readLong()), in.readString());
	}

	public Type getType() {
		return mType;
	}

	public Date getDate() {
		return mDate;
	}

	public String getLink() {
		return mLink;
	}

	public int describeContents() {
		return 0;
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(mType.name());
		dest.writeLong(mDate.getTime());
		dest.writeString(mLink);
	}

	public static final Parcelable.Creator<FileUpdateInfo> CREATOR = new Parcelable.Creator<FileUpdateInfo>() {
		public FileUpdateInfo createFromParcel(Parcel in) {
			return new FileUpdateInfo(in);
		}

		public FileUpdateInfo[] newArray(int size) {
			return new FileUpdateInfo[size];
		}
	};
}
